package com.huangguolin.cloud.api.user.repository;

import com.huangguolin.cloud.api.user.entity.ApiUserEntity;
import com.huangguolin.cloud.mybatis.entity.PtIndividualEntity;
import com.huangguolin.cloud.mybatis.entity.PtUserEntity;
import com.huangguolin.cloud.mybatis.flexigrid.PagingEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ApiDao {
    /**
     * 注册用户
     * @param userName
     * @param passWord
     * @param identity
     * @param phone
     * @param email
     */
    public void register(@Param("userName")String userName,@Param("passWord") String passWord,@Param("identity") String identity,@Param("phone") String phone,@Param("email") String email);

    /**
     * 登录
     * @param userName
     * @param passWord
     * @return
     */
    List<PtUserEntity>  login(@Param("userName")String userName, @Param("passWord")String passWord);

    /**
     * 分页查询用户列表
     * @param paging
     * @param entity
     * @return
     */
    List<PtUserEntity> queryUserList(@Param("paging")PagingEntity paging, @Param("entity")ApiUserEntity entity);

    /**
     * 查询用户总条数
     * @param entity
     * @return
     */
    Integer queryUserTotal( @Param("entity")ApiUserEntity entity);

    /**
     * 修改个人信息
     * @param userUuid
     * @param userName
     * @param gender
     * @param birthday
     * @param signature
     * @param occupation
     * @param firm
     * @param hometown
     * @param phone
     * @param email
     * @param personalInstructions
     */
    void personalInformation(@Param("userUuid")String userUuid,@Param("userName")String userName,@Param("gender") String gender, @Param("birthday")String birthday, @Param("signature")String signature,@Param("occupation") String occupation, @Param("firm")String firm, @Param("hometown")String hometown, @Param("phone")String phone, @Param("email")String email,@Param("personalInstructions") String personalInstructions);

    /**
     * 查询用户uuid
     * @param userName
     * @param passWord
     * @return
     */
    String query(@Param("userName")String userName,@Param("passWord")String passWord);

    /**
     * 查询个人信息
     * @param userUuid
     * @return
     */
    List<PtIndividualEntity> queryUser(@Param("userUuid")String userUuid);

    /**
     * 修改个人信息
     * @param userUuid
     * @param userName
     * @param gender
     * @param birthday
     * @param signature
     * @param occupation
     * @param firm
     * @param hometown
     * @param phone
     * @param email
     * @param personalInstructions
     */
    void revise (@Param("userUuid")String userUuid,@Param("userName")String userName,@Param("gender") String gender, @Param("birthday")String birthday, @Param("signature")String signature,@Param("occupation") String occupation, @Param("firm")String firm, @Param("hometown")String hometown, @Param("phone")String phone, @Param("email")String email,@Param("personalInstructions") String personalInstructions);

    /**
     * 编辑教师个人信息
     * @param userName
     * @param nickname
     * @param password
     * @param sex
     * @param level
     * @param phone
     * @param email
     * @param introduction
     */
    void reviseTea(@Param("userName")String userName,
                   @Param("nickname") String nickname,
                   @Param("password") String password,
                   @Param("sex") Integer sex,
                   @Param("level") Integer level,
                   @Param("phone")String phone,
                   @Param("email")String email,
                   @Param("introduction")String introduction,
                   @Param("photo") String photo);
    /**
     * 修改密码
     * @param userName
     * @param passWord
     */
    void forget(@Param("userName")String userName,@Param("passWord")String passWord);

    /**
     * 删除用户
     * @param userIdArray
     */
    void deleteUser(@Param("userIdArray")String[] userIdArray);

    /**
     * 分页查询教师信息
     * @param paging
     * @param entity
     * @return
     */
    List<PtUserEntity> queryUserTeacherList(@Param("paging") PagingEntity paging,@Param("entity") ApiUserEntity entity);

    /**
     * 查询教师信息总条数
     * @param entity
     * @return
     */
    Integer queryUserTeacherTotal(@Param("entity") ApiUserEntity entity);
    /**
     * 分页查询学生信息
     * @param paging
     * @param entity
     * @return
     */
    List<PtUserEntity> queryUserStudentList(@Param("paging") PagingEntity paging,@Param("entity") ApiUserEntity entity);

    /**
     * 查询学生信息总条数
     * @param entity
     * @return
     */
    Integer queryUserStudentTotal(@Param("entity") ApiUserEntity entity);

    /**
     * 删除教师用户
     * @param userPhoneArray
     */
    void deleteUserTea(@Param("userPhoneArray") String[] userPhoneArray);
    /**
     * 删除学生用户
     * @param userPhoneArray
     */
    void deleteUserStu(@Param("userPhoneArray") String[] userPhoneArray);
    /**
     * 查询教师个人信息
     * @param phone
     * @return
     */
    List<PtUserEntity> queryUserTea(@Param("phone")String phone);

    /**
     * 添加教师用户
     * @param userName
     * @param nickname
     * @param password
     * @param sex
     * @param level
     * @param role
     * @param phone
     * @param email
     * @param introduction
     */
    void AddUserTea(@Param("userName")String userName,
                    @Param("nickname")String nickname,
                    @Param("password")String password,
                    @Param("sex")Integer sex,
                    @Param("level")Integer level,
                    @Param("role")Integer role,
                    @Param("phone")String phone,
                    @Param("email")String email,
                    @Param("introduction")String introduction,
                    @Param("photo") String photo);

    /**
     *
     * @param userName
     * @param nickName
     * @param password
     * @param id
     * @param phone
     * @param email
     * @param qqNumber
     * @param introduction
     * @param signature
     */
    void PlusUser(@Param("userName")String userName, @Param("nickName")String nickName, @Param("password")String password, @Param("id")Integer id,@Param("phone") String phone,@Param("email") String email, @Param("qqNumber")String qqNumber, @Param("introduction")String introduction, @Param("signature")String signature);
}
